home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
include
/
dvstd.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
28KB
|
752 lines
/* @(#)dvstd.h V2.94 6/14/95 */
/*
| file name -- dvstd.h
|===================================================================
|
| copyright (c) 1987
| V.I. Corporation
|
| dvstd.h -- DataViews Public Types and some constant definitions
|
| alan c morse 6 dec 82
|
| alan c morse 31 Dec 83 Add DIV_BY_* macros
| alan c morse 13 April 84 Add DV_COORD typedef
| alan c morse 19 April 84 Add V_FV_MULT_RANGE and
| shorten some names to
| be unique in seven characters
| alan c morse 23 Dec 86 Add PV_PAIR
| russell turner 29 Dec 87 Add COLOR_TABLE typedef
| russell turner 26 Feb 88 Add VPdgaxlabel/vdsymbol flags
| john methot 19 dec 90 Add V_GLOBAL, V_LOCAL
| marianne smith 16 Jan 91 Added V_BF_LATEST_N, V_BF_DISP,
| V_BF_UNDISP, V_BF_OLD_TO_NEW, and
| V_BF_NEW_TO_OLD.
| marianne smith 22 Jan 91 Added display formatter status flags.
| marianne smith 29 may 91 Added V_Q_DATA_SLOTSIZE query flag.
| lynn smith 12 Apr 94 Changed COORD, POINT, SUCCESS to DV_*
|
|===================================================================
|
| include-file description/function:
| This contains the typedefs for DataViews Public Types.
| These are types which can be accessed directly by the dataviews
| application programmer. This is in contrast to
| Dataviews Private Types, which can only be accessed
| through DV-Tools functions.
| Also, some constant definitions are contained.
|
|===================================================================
*/
#ifndef DVSTD_H
#define DVSTD_H
#include "std.h"
#include "dvmarker.h"
#include "dvdatatypes.h"
#include "dvfonts.h"
#define DV_SUCCESS YES
#define DV_FAILURE NO
/*
COLOR_SPEC and RGB_SPEC typedef.
Typedef for a structure that describes a color to be used
in DataViews. It allows the representation of an index into
a device's color lookup table or an r,g,b color specification.
The representation comprises four bytes. The first is a flag
that determines the type of representation. If the first byte
is zero, then the four bytes are an index into a color lookup table.
If the first byte is -1, then the remaining three bytes correspond
to the rgb representation of a color. (This is the RGB_SPEC
typedef. Note that the -1 as the rgb_rep_flag is only necessary
when RGB_SPEC is included in a COLOR_SPEC typedef. If the typedef
is used in a structure by itself--as when setting up the color
lookup table with GRs_color_table--then this flag is unnecessary.)
NOTE that this representation is MACHINE DEPENDENT.
The structure should be declared so that the
rgb_rep_flag corresponds to the position of the high byte of a
long integer.
*/
typedef struct _RGB_SPEC
{
#ifdef BYTE_ORDER_1234
char rgb_rep_flag; /* Should be -1 when used in COLOR_SPEC */
UBYTE red, green, blue;
#endif
#ifdef BYTE_ORDER_4321
UBYTE blue, green, red;
char rgb_rep_flag; /* Should be -1 when used in COLOR_SPEC */
#endif
} RGB_SPEC;
typedef union COLOR_SPEC
{
LONG color_index; /* Should always be >= 0 */
RGB_SPEC rgb_rep;
} COLOR_SPEC;
/* Color index to indicate that a color field is not yet defined */
#define UNDEFINED_COLOR_INDEX 0x7fffffff
/*
COLOR_TABLE typedef
Data structure used for storing the color look-up table.
*/
typedef struct
{
int ctsize;
RGB_SPEC ct[256];
} COLOR_TABLE;
/* COLOR_XFORM typedef
Data structure for defining a transformation from one color table's
indices to another's.
*/
typedef struct
{
int size;
int new_index[256];
} COLOR_XFORM;
/*
COLOR_THRESHOLD typedef.
Entry in a thresholding table that gives the color associated with a
variable as a function of the variable's value, where the color
of the display of the variable depends on the normalized
(in range [0,32767] ) variable value as follows:
use threshcolor i ( 1<=i<=colcount ) such that
upperlimit( i-1 ) < value <= upperlimit(i).
NOTE upperlimit(0) = 0 by definition.
*/
typedef struct COLOR_THRESHOLD
{
short upperlimit;
COLOR_SPEC threshcolor;
} COLOR_THRESHOLD;
/*
PLR_POINT typedef.
This is the structure for polar coordinates of a point.
*/
typedef struct PLR_POINT
{
short radius;
short angle;
} PLR_POINT;
/*
DV_COORD, DV_POINT typedefs.
This is the structure for the coordinates of a point.
*/
typedef LONG DV_COORD;
typedef struct DV_POINT
{
DV_COORD x;
DV_COORD y;
} DV_POINT;
/* FLOAT_POINT, where the coordinates are stored as floats. */
/* This is useful for greater precision than POINTs */
/* or for storing points that are in normalized device coords. */
/* In the latter case, the lower left corner would be (0.0, 0.0) */
/* and the upper right would be (1.0, 1.0) */
typedef struct FLOAT_POINT
{
float x,y;
} FLOAT_POINT;
/*
ANYTYPE typedef.
Typdef for use when a variable can be one of several scalar types.
*/
typedef union ANYTYPE
{
char c;
UBYTE uc;
short s;
unsigned short us;
LONG l;
ULONG ul;
float f;
double d;
ADDRESS ptr;
union ANYTYPE *ap;
} ANYTYPE;
/*
| DV_STRUCT_MEMBER typedef.
| Describes the elements of a structure.
*/
typedef struct DV_STRUCT_MEMBER
{
char *name; /* name of field */
char *type; /* name of field's type */
short offset; /* offset of field in structure */
} DV_STRUCT_MEMBER;
/*
NAME_VALUE_PAIR typedef.
Name-value pair for passing arguments to display formatters.
*/
typedef struct
{
char *name;
char *value;
} NAME_VALUE_PAIR;
/*
LABEL_SIZE typedef.
Describes the size attributes of a string. This is used by
axis labelling routines to return the attributes of an axis
tick label, which may be multiline strings.
*/
typedef struct
{
int StringLength; /* Number of characters in the string */
short NumLines; /* Number of lines in the string;
| 0 or 1 means that it is a single line string.
| More than 1 means that there are imbedded carriage
| returns. */
short LongestLine; /* Number of characters in
| the longest line of the multi-line string. If there
| is only one line this value is the same as the
| StringLength. In the case where NumLines is zero,
| and LongestLine is zero, the value for LongestLine
| is taken to be equal to StringLength */
} LABEL_SIZE;
/*
ENTRY_PT typedefs.
This is an entry point for a function that returns a int
*/
typedef int (*ENTRY_PT)();
/*
RECTANGLE typedef.
This structure contains the corner points that define a rectangle
that is oriented orthogonally with respect to the coordinate system.
Thus RECTANGLE can be used to define a viewport. The two points
are the lower left and the upper right corners of the rectangle.
*/
typedef struct RECTANGLE
{
DV_POINT ll; /* Lower left corner of the rectangle. */
DV_POINT ur; /* Upper right corner of the rectangle. */
} RECTANGLE;
/*
RECTANGLE_PRE_9_1 typedef
This is the type of rectangle that is compatible
with the RECTANGLE structure for releases of DataViews prior to 9.1.
*/
typedef struct RECTANGLE_PRE_9_1
{
struct { short x,y; } ll; /* Lower left corner of the rectangle. */
struct { short x,y; } ur; /* Upper right corner of the rectangle. */
} RECTANGLE_PRE_9_1;
/*
PIXREP typedef.
This structure provides a way to describe arbitrary pixel-based
graphics data. See the file VUpixrep.h for more information.
*/
typedef struct
{
int width, height; /* width and height in pixels */
UBYTE depth; /* number of bits of color information */
UBYTE bits_per_pixel; /* 1,2,4,8,16,32 bits */
UBYTE row_alignment; /* 8,16,32==Rows aligned on char,short,LONG */
DV_BOOL origin_at_ll; /* is origin in lower-left? */
UBYTE pack_unit; /* if bits/pixel < 8, packing unit */
DV_BOOL pack_msf_in_byte; /* if bits/pixel < 8, order of pixels in byte */
DV_BOOL pack_msf_in_unit; /* if bits/pixel < 8, order of bytes in unit */
LONG pixels_length; /* length of pixel array */
UBYTE *pixels; /* actual pixels */
/* if (pclut != NULL), pixels are index into color table (*pclut) */
COLOR_TABLE *pclut;
DV_BOOL *color_used; /* which colors actually used (if known) */
/* if (pclut == NULL), pixels are direct color: */
ULONG red_mask;
int red_shift;
ULONG grn_mask; /* For green component of pixel, calculate */
int grn_shift; /* ((pixel & grn_mask) >> grn_shift) */
ULONG blu_mask;
int blu_shift; /* & similarly for red and blue components */
} PIXREP;
/*-------------------------------------------------------------
|
| Private types used by the VP/VG/VU/VT
*/
/* Define data group pointers and variable descriptor pointers */
/* for end applications programmers */
#ifndef DATAGROUP
#define DATAGROUP ADDRESS /* dgp -- data group */
#endif
#define VARDESC ADDRESS /* vdp -- variable descriptor */
#define DISPFORM ADDRESS /* df display formatter */
#define SYMTABLE ADDRESS /* st symbol table */
#define SYMNODE ADDRESS /* sn symbol table node */
/* Obsolete synonyms */
#define DG_PTR ADDRESS
#define VD_PTR ADDRESS
#define VAR_DESC ADDRESS
/*===================================================================
| Constants used by TdsvGet/SetGlobalFlag
| -----------------------------------------------------------------
*/
#define V_LOCAL 1
#define V_GLOBAL 2
/*===================================================================
| Constants used by TdsvEdit/GetAttributes
| -----------------------------------------------------------------
*/
#define V_SINGLE_QUOTED '\001'
#define V_DOUBLE_QUOTED '\002'
/*-------------------------------------------------------------------
| Flags used by VP/VGinfo()
*/
typedef enum
{
DV_DG_ATTR_ARGEND,
DV_DG_AXIS_LABEL, /* Axis label */
DV_DG_CONTEXT, /* Context flags */
DV_DG_DF, /* Display formatter */
DV_DG_DF_ADD_ARG, /* Add/get a single arg/value pair */
DV_DG_DF_ARG_VALUE, /* Get value for a single arg */
DV_DG_DF_ARGS, /* Get/set an array of arg/values */
DV_DG_DF_CONTEXT_ONLY, /* Context only flag */
DV_DG_DF_DEL_ARG, /* Delete arg/value pair */
DV_DG_GRID_ATTR, /* Grid attributes */
DV_DG_SCROLL_AMOUNT, /* Scroll amount */
DV_DG_SLOTS, /* Slots for time series */
DV_DG_TIC_LAB_FCN, /* Tic labelling function */
DV_DG_TIME_START_INCR, /* Start time and increment */
DV_DG_TITLE /* Title for graph */
} DV_DG_ATTR_ENUM;
typedef enum
{
DV_VD_ATTR_ARGEND,
DV_VD_ACC_MODE, /* Access mode */
DV_VD_DRANGE, /* Range as doubles */
DV_VD_IRANGE, /* Range as ints */
DV_VD_ACCESS, /* Access function */
DV_VD_BASE, /* Base addres */
DV_VD_CLR_INDX, /* Color index */
DV_VD_CTT, /* Color threshold table */
DV_VD_DIM, /* Dimension */
DV_VD_DIRECT_ACCESS, /* Is variable accessed directly? */
DV_VD_LOG, /* Log/linear flag */
DV_VD_LTYPE, /* Line type */
DV_VD_LWIDTH, /* Line width */
DV_VD_RGB, /* Color as rgb triple */
DV_VD_SYMBOL, /* Symbol */
DV_VD_TIC_LAB_FCN, /* Tic labelling function */
DV_VD_TYPE, /* Type of variable */
DV_VD_VAL_LABEL, /* Value label of variable */
DV_VD_VAR_NAME /* Name of variable */
} DV_VD_ATTR_ENUM;
/*===================================================================
| Context CONTROL FLAGS
| Constants which have bit patterns that correspond to the bit
| fields in the DATAGROUP structure for the context control flags.
| -----------------------------------------------------------------
*/
#define V_FPRE_ERASE 0x1 /* Erase before drawing? */
#define V_FCONTEXT 0x2 /* Draw context? */
#define V_FLEGEND 0x4 /* Draw legend? */
#define V_FVPBOX 0x8 /* Draw box around graph? */
#define V_FT_TICS 0x10 /* Draw time axis ticks? */
#define V_FT_MINTICS 0x20 /* Minimum time ticks ? */
#define V_FT_LABEL_TICS 0x40 /* Label time axis ticks? */
#define V_FD1_TICS 0x80 /* Draw d1 axis ticks? */
#define V_FD1_MINTICS 0x100 /* Minimum d1 ticks ? */
#define V_FD1_LABEL_TICS 0x200 /* Label d1 axis ticks? */
#define V_FD2_TICS 0x400 /* Draw d2 axis ticks? */
#define V_FD2_MINTICS 0x800 /* Minimum d2 ticks ? */
#define V_FD2_LABEL_TICS 0x1000 /* Label d2 axis ticks? */
#define V_FV_TICS 0x2000 /* Draw value axis ticks? */
#define V_FV_MINTICS 0x4000 /* Minimum value ticks ? */
#define V_FV_LABEL_TICS 0x8000 /* Label value axis ticks? */
#define V_FV_MULT_RANGE 0x10000 /* Multiple value ranges? */
#define V_FV_GRID 0x20000 /* Draw value axis grid? */
#define V_FT_GRID 0x40000 /* Draw time axis grid? */
#define V_FPITCH_TICS 0x80000 /* Draw pitch tick marks. */
#define V_FPITCH_LABEL_TICS 0x100000 /* Label pitch tick marks. */
#define V_FROLL_TICS 0x200000 /* Draw roll tick marks */
#define V_FROLL_LABEL_TICS 0x400000 /* Label roll tick marks. */
#define V_F_ALL 0x7fffff /* All the flags */
/*-------------------------------------------------------------------
|
| ARGUMENT CONSTANTS --
| Definitions of constants for type flags to be sent to various
| DataViews routines.
|
| Flags for VPdgcreate indicating the type of data group to be created
*/
# define V_DGNORMAL 1
# define V_DGPROTOTYPE 2
# define V_DGTEMPORARY 3
/*
| Flags for VPdgaxlabel and VGdgaxlabel
*/
# define V_FIRST_AXIS '1'
# define V_SECOND_AXIS '2'
# define V_TIME_AXIS 't'
/* Flags for VPvdaccmode indicating the access mode of the variable */
/* V_DS_BOUND means that the variable is indirect access through a */
/* a DataViews data source */
# define V_DIR_ACCESS 0
# define V_INDIR_ACCESS 1
# define V_DS_BOUND 3
typedef LONG (*VGLONGACCESSFUNPTR) V_P_((ADDRESS args,
int i, int j, int k));
typedef double *(*VGDOUBLEACCESSFUNPTR) V_P_((ADDRESS args,
int i, int j, int k));
typedef ADDRESS (*VGADDRACCESSFUNPTR)V_P_((ADDRESS argp,
int i3, int i2, int i1));
typedef VGLONGACCESSFUNPTR VPLONGACCESSFUNPTR;
typedef VGDOUBLEACCESSFUNPTR VPDOUBLEACCESSFUNPTR;
typedef VGADDRACCESSFUNPTR VPADDRACCESSFUNPTR;
/* VPdgdfentry() takes a variety of different function pointers */
typedef int (*VPDGDFENTRYFUNPTR) V_P_(());
/*----------------------------------------------------------------------
|
| DISPLAY FORMATTER JUMP TABLE INDICES --
| Definitions of indices for the various entry points into a
| display formatter jump table. The jump table has a fixed size,
| and each position in the display jump table corresponds to
| a specific display formatter function according to the
| definitions below. Currently, these definitions
| CANNOT BE CHANGED without changing without recoding the
| table initializations for each display formatter.
| You can add to these definitions without affecting existing dfs.
| If the df doesn't have the appropriate function,
| the pointer is NULL.
|
| Number of pointers in jump table.
*/
# define V_DFTABLE_SIZE 11
/*
| Index of pointer to routine to call when this is the first time
| that this display formatter has been called for the data group.
*/
# define V_INITIAL_DISPLAY 0
/*
| Index of pointer to routine that cleans up the heap storage that
| the display formatter has allocated. This is called whenever
| the display formatter is disconnected from the data group.
| Also used as part of the new display formatter structure.
*/
# define V_CLEANUP_ALLOCS 1
/*
| Index of pointer to routine to call when the display context has
| already been created, and the display is to be updated to include
| the encoding of the latest data.
*/
# define V_UPDATE_DISPLAY 2
/*
| Index of pointer to routine to call when the display formatter is
| incapable of displaying the data in the data group.
| Whether this routine is to be called is determined by a call
| to the initial display formatter routine.
*/
# define V_CANT_DISPLAY 3
/*
| Index of pointer to routine to call when the user wants information
| from the display formatter. This routine expects two arguments.
| The first is a flag indicating the type of information required,
| the second is a pointer to a structure into which the routine is
| to put the answer. The routine returns a flag indicating whether
| it failed in answering the question. Success causes it to return
| DV_SUCCESS. If an error occurred it returns DV_FAILURE. The definitions
| of the possible flag values follow the list of pointer indices.
| Also used as part of the new display formatter structure.
*/
# define V_QUERY_DISPLAY 4
/***Entry points for the new display formatter structure***/
/*
| Index of pointer to routine to call before the first draw.
| Checks the data group (graph) against guard parameters which
| determine which data groups may be displayed.
| Allocates SAVED_DATA area if it doesn't exist yet. This may
| involve reallocating subparts of SAVED_DATA that have changed size.
| Lays out the graph area. Fills in information in SAVED_DATA area,
| which describes the graph layout and its behaviour.
| If can't draw with the current parameters, sets a flag in the
| SAVED_DATA area to that effect and installs a dummy displyay
| routine.
| Returns a flag indicating whether the context could be successfully
| set up.
*/
# define V_SETUP_DISPLAY 5
/*
| Index of pointer to routine to call to draw the static portion
| of the graph.
*/
# define V_DRAW_CONTEXT 6
/*
| Index of pointer to routine to call to draw the dynamic portion
| of the graph, displaying that portion of the data specified by
| the flag passed in as a parameter.
*/
# define V_DRAW_DATA 7
/*
| Index of pointer to routine to call to get the next iterations
| worth of data into the graphs data buffers, using the variable
| descriptors.
*/
# define V_TAKE_DATA 8
/*
| Index of pointer to routine to send flag and data value to
| to modify the runtime behaviour of the graph. For example,
| set up a new color threshold table.
*/
# define V_RECV_MESSAGE 9
/*
| Display formatter Status Flags.
| Constants which have bit patterns that correspond to the bit
| fields in the DATAGROUP structure for the display formatter status flags.
| -----------------------------------------------------------------
*/
#define V_DGDF_CANT_DRAW 0x1 /* Display formatter can't be drawn? */
#define V_DGDF_SETUP_DONE 0x2 /* Is setup of display formatter done? */
#define V_DGDF_CONTEXT_DRAWN 0x4 /* Is the context drawn? */
#define V_DGDF_ALL 0x7 /* All flags */
/*
| Definitions of possible flag values for V_DRAW_DATA and
| V_DRAW_CONTEXT. Release 8.0
*/
# define DV_NONE -1 /* Do not draw anything, for the internal use only */
# define V_LATEST_N 0 /* Draw n most recent pieces of data,
| where n is the number of history
| slots. */
# define V_ALL_NEW 1 /* Draw all undisplayed data */
# define V_OLD 2 /* Re-draw the last displayed data */
/*
| Definitions of possible draw_flag values for V_DRAW_DATA,
| V_DRAW_CONTEXT, and the VUbf functions. Release 9.0
*/
# define V_BF_LATEST_N V_LATEST_N /* Draw n most recent pieces of data,
| where n is the number of history
| slots. */
# define V_BF_UNDISP V_ALL_NEW /* Draw all undisplayed data */
# define V_BF_DISP V_OLD /* Re-draw the last displayed data */
/*
| Definitions of possible flag values for VUbfShift().
*/
#define V_BF_NEW_TO_OLD 1 /* Shift undisplayed data to the
| displayed data list. */
#define V_BF_OLD_TO_NEW 2 /* Shift the displayed data to the
| undisplayed data list.
| NOTE: Not yet implemented. */
/*
| Structure definitions for display formatter queries.
*/
#define V_Q_PICKED_VDP_MAX 64 /* Data Views will stop looking for
| vdps at a pick location when this
| many have been identified. */
typedef struct V_Q_VDP /* A vdp with its dgp index. Used in
| V_Q_VDP_LIST and V_Q_PICK_VDP structs. */
{
VARDESC vdp;
int index;
} V_Q_VDP;
typedef struct V_Q_VDP_LIST /* A list of V_Q_VDPs, plus a count. Used to
| provide output for V_Q_VDPS_AT_LOCATION
| query. */
{
int count;
V_Q_VDP vdps[V_Q_PICKED_VDP_MAX];
} V_Q_VDP_LIST;
typedef struct V_Q_PICK_VDP /* Pick location and a V_Q_VDP struct. Used
| as indata for V_Q_VALUE_AT_LOCATION,
| V_Q_DATA_VALUE and V_Q_FLOOR_VALUE
| queries. */
{
DV_POINT location;
V_Q_VDP *vdp;
} V_Q_PICK_VDP;
/*
| Definitions of possible flag values for V_QUERY_DISPLAY.
*/
# define V_Q_DATAVP 0 /* What is the rectangle that contains
| the data encoding area. The structure to receive the data is of
| type RECTANGLE. */
# define V_Q_SLOTSIZE 1 /* What is the area devoted to
| encoding each datum. The structure to receive the data is of
| type RECTANGLE. */
# define V_Q_VAL_AT_CURSOR 2 /* The display formatter should
| read the current cursor position. If it falls in a data slot,
| the routine returns the value of the data encoded in that slot.
| The structure that is to receive the data should be large enough
| to hold one data item from each variable. */
/* Display formatter-specific query flags */
# define V_Q_VDTITLE_TEXTVP 3 /* Get from the VDtitle display
| formatter the viewport rectangle that is used in displaying
| the text variables. */
# define V_Q_VDTITLE_CHARSIZE 4 /* Get from the VDtitle display
| formatter the character size used to display the text
| variables. */
# define V_Q_DOES_CLIPPING 5 /* Return DV_SUCCESS if formatter
| handles clipping (new display formatter structure), otherwise
| return DV_FAILURE. */
# define V_Q_LEGSIZE 6 /* Get the size of the legend
| from VDlegend. */
# define V_Q_DATA_SLOTSIZE 7 /* Get the size of one data element for
| VDspectro, VDspectroinp, VDspectrostacked and VDspectrointpstkd. */
# define V_Q_SLOT_AT_LOCATION 8 /* Get the slot index at the pick
| location. Data input is the pick location. Data output holds an int. */
# define V_Q_VDPS_AT_LOCATION 9 /* Get the indices of any vdps in the
| dgp at the pick location. Data input is the pick location. Data out
| is a struct containing list of (int) indices and an (int) count field.*/
# define V_Q_VALUE_AT_LOCATION 10 /* Get the value at the pick
| location. Data input holds the pick location. Data out holds a double,
| the value. */
# define V_Q_SAMPLE_AT_LOCATION 11 /* Get the interpolated sample
| number. Data input holds the pick location. Data out holds a double,
| the sample. */
# define V_Q_DATA_SAMPLE 12 /* Get the sample at the picked slot.
| Data input holds the pick location, data out holds the sample as
| a double. */
# define V_Q_DATA_VALUE 13 /* Get the value of the variable datum
| that contains the pick location. Data input holds a V_Q_PICK_VDP sruct.
| Data output holds the raw or normalized value as a double. */
# define V_Q_FLOOR_VALUE 14 /* Independent axis mapped value
| corresponding to bottom of picked datum (useful for Area and Pigback
| graphs). Data input holds a V_Q_PICK_VDP sruct, data output holds
| the floor value as a double. */
# define V_Q_SECTOR_AT_LOCATION 15 /* Get the sector index at the pick
| location in a Radial graph. Data input is the pick location. Data output
| holds an int. */
/* ---- QUERY FLAGS -- RESERVED FOR CUSTOMER USE ------------------
If you are a DataViews customer writing display formatters, for
which you need special QUERY flags, use flag values in the range [100-199].
You may then include the flags here.
*/
/*-------------------------------------------------------------------
| MACROS to optimize multiplication and division by some powers of two.
| These are accomplished by appropriate shifts on machines for which
| shifting does the right thing. (For instance, shifting will to the
| right thing on MC68000 and VAX computers). On no machine will these
| macros do the right thing for dividing negative numbers.
| This is because the numbers will be truncated away from zero rather
| than towards zero. This may not be disasterous, however.
| The MULTiplication macros will work equally for positive and
| negative numbers.
*/
# define DIV_2(a) ((a)>>1)
# define DIV_4(a) ((a)>>2)
# define DIV_8(a) ((a)>>3)
# define DIV_16(a) ((a)>>4)
# define MUL_2(a) ((a)<<1)
# define MUL_4(a) ((a)<<2)
# define MUL_8(a) ((a)<<3)
# define MUL_16(a) ((a)<<4)
/*-------------------------------------------------------------------
| Typedefs for hash tables.
*/
typedef ULONG (*VTHTCONVERTFUNPTR)V_P_((ADDRESS newkey));
typedef int (*VTHTCOMPAREFUNPTR)V_P_((ADDRESS key1, ADDRESS key2));
typedef void (*VTHTFREEKEYFUNPTR)V_P_((ADDRESS key));
typedef void (*VTHTFREEVALFUNPTR)V_P_((ADDRESS value));
typedef void (*VTHTTRAVERSEFUNPTR)V_P_((ADDRESS key, ADDRESS value, ADDRESS args));
typedef int (*VTSTCOMPAREFUNPTR)V_P_((ADDRESS searchkey, ADDRESS key));
typedef void (*VTSTTRAVERSEFUNPTR)V_P_((ADDRESS key, ADDRESS value, ADDRESS args));
/*-------------------------------------------------------------------
| Miscellaneous function pointers.
*/
typedef int (*VUSLTRVRSFUNPTR) V_P_((char *string,
int index,
ADDRESS argblock));
typedef int (*GRPALPICKFUNPTR) V_P_((LONG fbcolor, RECTANGLE *echovp));
/*-------------------------------------------------------------------
| values to control data structure traversals
| NOTE that these values should NOT be changed, because a lot of
| code assumes that CONTINUE is null.
*/
# define V_CONTINUE_TRAVERSAL 0
# define V_HALT_TRAVERSAL 1
/* Backward compatibility of upgraded typedefs and defines */
#ifdef DV_OLD_NAMES
#ifdef NOT_WINNT
#define POINT DV_POINT
#define COORD DV_COORD
#define SUCCESS DV_SUCCESS
#define FAILURE DV_FAILURE
#define V_NONE DV_NONE
#endif /* NOT_WINNT */
#endif /* DV_OLD_NAMES */
#ifdef WINNT
#define DV_PORTRAIT 1
#define DV_LANDSCAPE 2
#define DV_DRAFT -1
#define DV_LOW -2
#define DV_MEDIUM -3
#define DV_HIGH -4
#endif
#endif /* DVSTD_H */